<!DOCTYPE html>
<html>
<head>
    <title>Try-Catch Example</title>
</head>
<body>
    <script type="text/javascript">
        try {
            window.someNonexistentFunction();
        } catch (error){
            alert(error.name);
            alert(error.message);
        }
        
    </script>
</body>
</html>
